<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title><?php echo ($meta_title); ?>|OneThink管理平台</title>
    <link href="/Public/favicon.ico" type="image/x-icon" rel="shortcut icon">
    <link rel="stylesheet" type="text/css" href="/Public/Admin/css/base.css" media="all">
    <link rel="stylesheet" type="text/css" href="/Public/Admin/css/common.css" media="all">
    <link rel="stylesheet" type="text/css" href="/Public/Admin/css/module.css">
    <link rel="stylesheet" type="text/css" href="/Public/Admin/css/style.css" media="all">
    <link rel="stylesheet" type="text/css" href="/Public/Admin/css/table.css" media="all">
	<link rel="stylesheet" href="/Public/Admin/css/fakeLoader.css">
	<link rel="stylesheet" type="text/css" href="/Public/Admin/css/<?php echo (C("COLOR_STYLE")); ?>.css" media="all">
	
	

     <!--[if lt IE 9]>
    <script type="text/javascript" src="/Public/static/jquery-1.10.2.min.js"></script>
    <![endif]--><!--[if gte IE 9]><!-->
    <script type="text/javascript" src="/Public/static/jquery-2.0.3.min.js"></script>
    <script type="text/javascript" src="/Public/Admin/js/jquery.mousewheel.js"></script>
    <script src="/Public/static/thinkbox/laydate.js"></script>
    <script src="/Public/static/echarts.min.js"></script>
    <script src="/Public/static/macarons.js"></script>
	<!-- <script type="text/javascript" src="/Public/static/lte-ie7.js"></script> -->
    <!--<![endif]-->
    
</head>
<body>
    <!-- 头部 -->
    <div class="header">
        <!-- Logo -->
        <span class="logo"></span>
        <!-- /Logo -->

        <!-- 主导航 -->
        <ul class="main-nav">
            <?php if(is_array($__MENU__["main"])): $i = 0; $__LIST__ = $__MENU__["main"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$menu): $mod = ($i % 2 );++$i;?><li class="<?php echo ((isset($menu["class"]) && ($menu["class"] !== ""))?($menu["class"]):''); ?>"><a href="<?php echo (U($menu["url"])); ?>"><?php echo ($menu["title"]); ?></a></li><?php endforeach; endif; else: echo "" ;endif; ?>
        </ul>
        <!-- /主导航 -->

        <!-- 用户栏 -->
	
        <div class="user-bar">
            <a href="javascript:;" class="user-entrance"><i class="icon-user"></i></a>
            <ul class="nav-list user-menu hidden">
                <li class="manager">你好，<em title="<?php echo session('user_auth.username');?>"><?php echo session('user_auth.username');?></em></li>
                <li><a href="<?php echo U('User/updatePassword');?>">修改密码</a></li>
                <li><a href="<?php echo U('User/updateNickname');?>">修改昵称</a></li>
                <li><a href="<?php echo U('Public/logout');?>">退出</a></li>
            </ul>
        </div>
		<div class="user-bar">
           <a href="<?php echo U('Ywxt/index',array('jrzjtx'=>100,'p'=>1));?>"  style="color: white; background: #383838;" >
               <i style="display: block;
    margin-top: 15px;
    padding-bottom: 15px;
    width: 45px;
    height: 20px;
    background: url(/Public/Admin/images/email.png) no-repeat;"></i>
               <span style="background: #FF6C60;border-radius: 2px;-webkit-border-radius: 2px;font-size: 10px;font-weight: normal;line-height: 13px;padding: 2px 5px;position: absolute;right: 4px;top: 10px;"><?php echo ($jrzjtx["ts"]); ?></span>
           </a>
        </div>
	    <div class="user-bar">
           <a href="<?php echo U('Ywxt/index',array('jdlstx'=>100,'p'=>1));?>"  style="color: white; background: #383838;" >
               <i style="display: block;
    margin-top: 15px;
    padding-bottom: 15px;
    width: 45px;
    height: 20px;
    background: url(/Public/Admin/images/filter.png) no-repeat;"></i>
               <span style="background: #FF6C60;border-radius: 2px;-webkit-border-radius: 2px;font-size: 10px;font-weight: normal;line-height: 13px;padding: 2px 5px;position: absolute;right: 4px;top: 10px;"><?php echo ($jdlstx["ts"]); ?></span>
           </a>
        </div>
    </div>
    <!-- /头部 -->

    <!-- 边栏 -->
    <div class="sidebar">
        <!-- 子导航 -->
        
            <div id="subnav" class="subnav">
                <?php if(!empty($_extra_menu)): ?>
                    <?php echo extra_menu($_extra_menu,$__MENU__); endif; ?>
                <?php if(is_array($__MENU__["child"])): $i = 0; $__LIST__ = $__MENU__["child"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$sub_menu): $mod = ($i % 2 );++$i;?><!-- 子导航 -->
                    <?php if(!empty($sub_menu)): if(!empty($key)): ?><h3><i class="icon icon-unfold"></i><?php echo ($key); ?></h3><?php endif; ?>
                        <ul class="side-sub-menu">
                            <?php if(is_array($sub_menu)): $i = 0; $__LIST__ = $sub_menu;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$menu): $mod = ($i % 2 );++$i;?><li>
                                    <a class="item" href="<?php echo (U($menu["url"])); ?>"><?php echo ($menu["title"]); ?></a>
                                </li><?php endforeach; endif; else: echo "" ;endif; ?>
                        </ul><?php endif; ?>
                    <!-- /子导航 --><?php endforeach; endif; else: echo "" ;endif; ?>
            </div>
        
        <!-- /子导航 -->
    </div>
    <!-- /边栏 -->

    <!-- 内容区 -->
    <div id="main-content">
        <div id="top-alert" class="fixed alert alert-error" style="display: none;">
            <button class="close fixed" style="margin-top: 4px;">&times;</button>
            <div class="alert-content">这是内容</div>
        </div>
        <div id="main" class="main">
            
            <!-- nav -->
            <?php if(!empty($_show_nav)): ?><div class="breadcrumb">
                <span>您的位置:</span>
                <?php $i = '1'; ?>
                <?php if(is_array($_nav)): foreach($_nav as $k=>$v): if($i == count($_nav)): ?><span><?php echo ($v); ?></span>
                    <?php else: ?>
                    <span><a href="<?php echo ($k); ?>"><?php echo ($v); ?></a>&gt;</span><?php endif; ?>
                    <?php $i = $i+1; endforeach; endif; ?>
            </div><?php endif; ?>
            <!-- nav -->
            

            
<style type="text/css">
/*-------- 下拉菜单 --------------*/
.dropMenu{position:absolute;top:0;visibility:hidden;margin-top:-2px; border-top:0;background-color:#eee;padding:4px;width:260px; }
.dropMenu span{float:left; padding-top:10px;}
.dropMenu a:hover{text-decoration:underline;color:#000;}
</style>
	<!-- 标题栏 -->
	<div class="main-title">
		<h2>业务列表</h2>
	</div>
        <h3 style="height: 33px; border-bottom: 1px solid #B1CEEF;line-height: 23px; color: #3176AD; font-weight: bold; margin-bottom: 10px">
         <div style="float:right;">
                <a  class="btn" href="<?php echo U('catdel');?>">已删除</a>
                <a  class="btn" href="<?php echo U('add');?>">新建预约单</a>
                <a  class="btn" href="<?php echo U('index',array('yytime_start'=>$jryydate['start'],'yytime_end'=>$jryydate['end']));?>">今日到店</a>
                <a  class="btn" href="<?php echo U('index');?>">所有订单</a>
          </div>      
            <div style="float:right;font-size:9px;color:red; line-height: 31px;">*注：选择<b>“今日到店”</b>后如果要查询其他单据，请先点击<b>“所有订单”</b>按钮。否则可能看到今日有预约的订单。-&gt; </div>
        </h3>
    <div class="data-table table-striped">
        <form action="<?php echo U();?>" method="post" style="padding: 5px;
        background: #eee;
        border: 1px solid #ccc;};
        count_form {      
        
        padding: 5px;
        background: #eee;
        border: 1px solid #ccc;};
        count_form {      
        padding: 5px;
        background: #eee;
        border: 1px solid #CFC7C7;">
            <p style="line-height:28px">
                订单ID：<input type="text" class="cusinput" name="Reserve[id]" style="width:120px;" value="<?php echo ($post_data["id"]); ?>">
                姓名：<input type="text" name="Reserve[name]" class="cusinput" style="width:120px;" value="<?php echo ($post_data["name"]); ?>">
				微信：<input type="text" name="Reserve[qq]" class="cusinput" style="width:120px;" value="<?php echo ($post_data["qq"]); ?>">
                手机：<input type="text" name="Reserve[phone]" class="cusinput" style="width:120px;" value="<?php echo ($post_data["phone"]); ?>">
				挖潜人：<input type="text" name="Reserve[waqianren]" class="cusinput" style="width:120px;" value="<?php echo ($post_data["waqianren"]); ?>">
                    <label>渠道</label>
                    <select name="Reserve[qd]" id="Reserve_cid">
                        <option  value="">全部</option>
                        <?php if(is_array($qudao)): $i = 0; $__LIST__ = $qudao;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option value="<?php echo ((isset($vo["uid"]) && ($vo["uid"] !== ""))?($vo["uid"]):null); ?>" <?php if(($vo["uid"]) == $post_data["qd"]): ?>selected<?php endif; ?>><?php echo ((isset($vo["name"]) && ($vo["name"] !== ""))?($vo["name"]):null); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                    </select>                                               
               
                        <label>线上门市</label>
                    <select name="Reserve[xsjd]" id="Reserve_usherid">
                        <option value="">所有</option>
                        <?php if(is_array($xianshang)): $i = 0; $__LIST__ = $xianshang;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option value="<?php echo ($vo["uid"]); ?>"  <?php if(($vo["uid"]) == $post_data["xsjd"]): ?>selected<?php endif; ?> ><?php echo ($vo["nickname"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                     </select>    
                        <label>线下门市</label>
                    <select name="Reserve[xxjd]" id="Reserve_usherid">
                        <option value="">所有</option>
                        <?php if(is_array($xianxia)): $i = 0; $__LIST__ = $xianxia;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option value="<?php echo ($vo["uid"]); ?>"  <?php if(($vo["uid"]) == $post_data["xxjd"]): ?>selected<?php endif; ?> ><?php echo ($vo["nickname"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                     </select>   
					 <br>
                              <label>挖潜部门</label>
                    <select name="Reserve[wqbm]" id="wqbm">
                        <option value="">所有</option>
                        <?php if(is_array($wqbm)): $i = 0; $__LIST__ = $wqbm;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option value="<?php echo ($vo["id"]); ?>"  <?php if(($vo["id"]) == $post_data["wqbm"]): ?>selected<?php endif; ?> ><?php echo ($vo["title"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                     </select>      
					<label>挖潜人员</label>					 
					 <select name="Reserve[wqry]" id="wqry">
                        <option value="">所有</option>
                        <?php if(is_array($wqry)): $i = 0; $__LIST__ = $wqry;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option value="<?php echo ($vo["id"]); ?>"  <?php if(($vo["id"]) == $post_data["wqry"]): ?>selected<?php endif; ?> ><?php echo ($vo["title"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                     </select>      
					 
					 <label>A客奖金</label>	
					 <select name="Reserve[akjj]">
                        <option value="" selected >所有</option>
                        <option value="1" <?php if(($post_data["akjj"]) == "1"): ?>selected<?php endif; ?>  >已发</option>
                        <option value="2" <?php if(($post_data["akjj"]) == "2"): ?>selected<?php endif; ?>  >未发</option>
                        </select>
				   
				   <label>成交奖金</label>	
				   <select name="Reserve[cjjj]">
                        <option value="" selected >所有</option>
                        <option value="1" <?php if(($post_data["cjjj"]) == "1"): ?>selected<?php endif; ?>  >已发</option>
                        <option value="2" <?php if(($post_data["cjjj"]) == "2"): ?>selected<?php endif; ?>  >未发</option>
                        </select>

                <br>
                建单时间：<input type="text" value="<?php echo ($post_data["jdtime_start"]); ?>" name="Reserve[jdtime_start]" class="date" style="width:130px;" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm'})"> - <input type="text" value="<?php echo ($post_data["jdtime_end"]); ?>" name="Reserve[jdtime_end]" class="date" style="width:130px;" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm'})">
                预约时间：<input type="text" value="<?php echo ($post_data["yytime_start"]); ?>" name="Reserve[yytime_start]" class="date" style="width:80px;" onclick="laydate()"> - <input type="text" value="<?php echo ($post_data["yytime_end"]); ?>" name="Reserve[yytime_end]" class="date" style="width:80px;" onclick="laydate()">
                签订时间：<input type="text" value="<?php echo ($post_data["ddtime_start"]); ?>" name="Reserve[ddtime_start]" class="date" style="width:80px;"onclick="laydate()"> - <input type="text" value="<?php echo ($post_data["ddtime_end"]); ?>" name="Reserve[ddtime_end]" class="date" style="width:80px;" onclick="laydate()">
				线下服务时间：<input type="text" value="<?php echo ($post_data["xxfwtime_start"]); ?>" name="Reserve[xxfwtime_start]" class="date" style="width:80px;"onclick="laydate()"> - <input type="text" value="<?php echo ($post_data["xxfwtime_end"]); ?>" name="Reserve[xxfwtime_end]" class="date" style="width:80px;" onclick="laydate()">       
                <br>
				进店时间：<input type="text" value="<?php echo ($post_data["jindtime_start"]); ?>" name="Reserve[jindtime_start]" class="date" style="width:80px;" onclick="laydate()"> - <input type="text" value="<?php echo ($post_data["jindtime_end"]); ?>" name="Reserve[jindtime_end]" class="date" style="width:80px;" onclick="laydate()">
				未到店时间：<input type="text" value="<?php echo ($post_data["wddtime_start"]); ?>" name="Reserve[wddtime_start]" class="date" style="width:80px;"  onclick="laydate()"> - <input type="text" value="<?php echo ($post_data["wddtime_end"]); ?>" name="Reserve[wddtime_end]" class="date" style="width:80px;"  onclick="laydate()">
                流失时间：<input type="text" value="<?php echo ($post_data["lstime_start"]); ?>" name="Reserve[lstime_start]" class="date" style="width:80px;" onclick="laydate()"> - <input type="text" value="<?php echo ($post_data["lstime_end"]); ?>" name="Reserve[lstime_end]" class="date" style="width:80px;" onclick="laydate()">
				<label for="">类别</label>
                    <select name="Reserve[lb]" id="Reserve_cid">
                        <option  value="">全部</option>
                        <?php if(is_array($liebei)): $i = 0; $__LIST__ = $liebei;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option value="<?php echo ((isset($vo["uid"]) && ($vo["uid"] !== ""))?($vo["uid"]):null); ?>" <?php if(($vo["uid"]) == $post_data["lb"]): ?>selected<?php endif; ?>><?php echo ((isset($vo["name"]) && ($vo["name"] !== ""))?($vo["name"]):null); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                    </select>    
				<br>

                    <?php if(in_array(4,session('user_auth.level'))): else: ?>
                                客服工号：<select name="Reserve[kf]" id="Reserve_service_id">
                        <option value="">所有</option>
                        <?php if(is_array($kefu)): $i = 0; $__LIST__ = $kefu;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option value="<?php echo ($vo["uid"]); ?>" <?php if(($vo["uid"]) == $post_data["kf"]): ?>selected<?php endif; ?>  ><?php echo ($vo["nickname"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                                           </select><?php endif; ?>                        
                            订单状态：<select name="Reserve[ywstate]">
                        <option value="" selected >所有</option>
                           <?php if(is_array($state)): $i = 0; $__LIST__ = $state;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option value="<?php echo ($vo["uid"]); ?>" <?php if(($vo["uid"]) == $post_data["ywstate"]): ?>selected<?php endif; ?>  ><?php echo ($vo["name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                                </select>

                   顾客标签：<select name="Reserve[gkbq]">
                        <option value="" selected >所有</option>
                           <?php if(is_array($gkbq)): $i = 0; $__LIST__ = $gkbq;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option value="<?php echo ($vo["uid"]); ?>" <?php if(($vo["uid"]) == $post_data["gkbq"]): ?>selected<?php endif; ?>  ><?php echo ($vo["name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                        </select>


            <span class="buttons">
                <input type="submit"  id="submit" class="btn" value="开始查询">
            </span>
            </p>
        </form>
		<form action="<?php echo U('Excel/out');?>" METHOD="post" style="  margin-top: -36px;
    margin-left: 600px;">
            <input type="hidden" name="excl" value="1">
            <input type="hidden" name="Reserve[orderid]"  value="<?php echo ($post_data["orderid"]); ?>">
            <input type="hidden" name="Reserve[name]" value="<?php echo ($post_data["name"]); ?>">
            <input type="hidden" name="Reserve[phone]" value="<?php echo ($post_data["phone"]); ?>">
            <input type="hidden" name="Reserve[qq]"  value="<?php echo ($post_data["qq"]); ?>">
            <input type="hidden"  name="Reserve[qd]" value="<?php echo ($post_data["qd"]); ?>">
            <input type="hidden" name="Reserve[kf]" value="<?php echo ($post_data["kf"]); ?>">
            <input type="hidden" name="Reserve[lb]" value="<?php echo ($post_data["lb"]); ?>">
            <input type="hidden" name="Reserve[ywstate]" value="<?php echo ($post_data["ywstate"]); ?>">
            <input type="hidden" value="<?php echo ($post_data["jdtime_start"]); ?>" name="Reserve[jdtime_start]">
            <input type="hidden" value="<?php echo ($post_data["jdtime_end"]); ?>" name="Reserve[jdtime_end]">
            <input type="hidden" value="<?php echo ($post_data["yytime_start"]); ?>" name="Reserve[yytime_start]" >
            <input type="hidden" value="<?php echo ($post_data["yytime_end"]); ?>" name="Reserve[yytime_end]">
            <input type="hidden" value="<?php echo ($post_data["ddtime_start"]); ?>" name="Reserve[ddtime_start]">
            <input type="hidden" value="<?php echo ($post_data["ddtime_end"]); ?>" name="Reserve[ddtime_end]">
			<input type="hidden" value="<?php echo ($post_data["lstime_start"]); ?>" name="Reserve[lstime_start]">
            <input type="hidden" value="<?php echo ($post_data["lstime_end"]); ?>" name="Reserve[lstime_end]">
			<input type="hidden" value="<?php echo ($post_data["wddtime_start"]); ?>" name="Reserve[wddtime_start]">
            <input type="hidden" value="<?php echo ($post_data["wddtime_end"]); ?>" name="Reserve[wddtime_end]">
			<input type="hidden" value="<?php echo ($post_data["jindtime_start"]); ?>" name="Reserve[jindtime_start]">
            <input type="hidden" value="<?php echo ($post_data["jindtime_end"]); ?>" name="Reserve[jindtime_end]">
            <input type="hidden" name="Reserve[xxjd]" value="<?php echo ($post_data["xxjd"]); ?>">
            <input type="hidden" name="Reserve[xsjd]" value="<?php echo ($post_data["xsjd"]); ?>">
            <span class="buttons">
            <input type="submit"   class="btn" style="" value="生成报表">
            </span>
        </form>
</div>
	<div class="cf">
<!-- 		<div class="fl">
            <a class="btn" href="<?php echo U('add');?>">新 增</a>
            <button class="btn ajax-post confirm" url="<?php echo U('del');?>" target-form="ids">删 除</button>
        </div> -->

    <div style="text-align: right;"> 本页共 :<?php echo count($_list); ?> 条数据、套系金额：<?php echo ($zhongji["setmoney"]); ?>元、实收金额：<?php echo ($zhongji["money"]); ?>元</div>
    </div>
    <!-- 数据列表 -->
    <div class="table-striped">
    <form class="items">
        <table style="background: white;    border-collapse: collapse;    width: 100%;    border: 1px #D0E3EF solid;">

       
        <thead>
            <tr>
            <!-- <th class="row-selected"><input class="check-all" type="checkbox"/></th> -->
            <th class="">ID</th>
            <th >姓名</th>
            <th >微信</th>
            <th class="">手机</th>
            <th style="width:64px;"><a style="color:#FFFFFF" href="<?php if($_GET['jdtime'] == 'desc'): echo U('index',array('jdtime'=>'asc')); else: echo U('index',array('jdtime'=>'desc')); endif; ?>">建单日期</a></th>
            <th class=""><a style="color:#FFFFFF" href="<?php if($_GET['yytime'] == 'desc'): echo U('index',array('yytime'=>'asc')); else: echo U('index',array('yytime'=>'desc')); endif; ?>">预约时间</a></th>
            <th class=""><a style="color:#FFFFFF" href="<?php if($_GET['kf'] == 'desc'): echo U('index',array('kf'=>'asc')); else: echo U('index',array('kf'=>'desc')); endif; ?>">客服</a></th>
            <th style="width:30px;" ><a style="color:#FFFFFF" href="<?php if($_GET['xsjd'] == 'desc'): echo U('index',array('xsjd'=>'asc')); else: echo U('index',array('xsjd'=>'desc')); endif; ?>">线上门市</a></th>
            <th style="width:30px;"><a style="color:#FFFFFF" href="<?php if($_GET['xxjd'] == 'desc'): echo U('index',array('xxjd'=>'asc')); else: echo U('index',array('xxjd'=>'desc')); endif; ?>">线下门市</a></th>
			<th style="width:30px;">原挖潜人</th>
			<th style="width:30px;">挖潜部门</th>
			<th style="width:30px;">挖潜人</th>
            <th class=""><a style="color:#FFFFFF" href="<?php if($_GET['qdstase'] == 'desc'): echo U('index',array('qdstase'=>'asc')); else: echo U('index',array('qdstase'=>'desc')); endif; ?>">渠道</a></th>
            <th class=""><a style="color:#FFFFFF" href="<?php if($_GET['setmoney'] == 'desc'): echo U('index',array('setmoney'=>'asc')); else: echo U('index',array('setmoney'=>'desc')); endif; ?>">套系价格</a></th>
            <th class=""><a style="color:#FFFFFF" href="<?php if($_GET['money'] == 'desc'): echo U('index',array('money'=>'asc')); else: echo U('index',array('money'=>'desc')); endif; ?>">实收金额</a></th>
            <th style="width:50px;"><a style="color:#FFFFFF" href="<?php if($_GET['ywstate'] == 'desc'): echo U('index',array('ywstate'=>'asc')); else: echo U('index',array('ywstate'=>'desc')); endif; ?>">订单状态</a></th>
            <th class=""><a style="color:#FFFFFF" href="<?php if($_GET['lb'] == 'desc'): echo U('index',array('lb'=>'asc')); else: echo U('index',array('lb'=>'desc')); endif; ?>">类别</a></th>
			<th class="">线上备注</th>
            <th class="">线下备注</th>
			<th class="">顾客标签</th>
			<th class="">A客奖金</th>
			<th class="">成交奖金</th>
            <th style="width:75px;"><a style="color:#FFFFFF" href="<?php if($_GET['cztime'] == 'desc'): echo U('index',array('cztime'=>'asc')); else: echo U('index',array('cztime'=>'desc')); endif; ?>">最后操作</a></th>
            <th class="">操作</th>
            </tr>
        </thead>
        <tbody id="navMenu">
            <?php if(!empty($_list)): if(is_array($_list)): $i = 0; $__LIST__ = $_list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>
              <!--   <td><input class="ids row-selected" type="checkbox" name="id[]" value="<?php echo ($vo["id"]); ?>" /></td> -->
                <td class="money_id" name="<?php echo ($vo["id"]); ?>" id="<?php echo ($vo["id"]); ?>"><?php echo ($vo["id"]); ?></td>
                <td><?php echo ($vo["name"]); ?></td>
                <td><?php echo ($vo["qq"]); ?></td>
                <td><?php echo ($vo["phone"]); ?></td>
                <td><?php echo (time_format($vo["jdtime"])); ?></td>
                <td><?php if(($vo["yytime"]) != "0"): echo (time_format($vo["yytime"])); endif; ?></td>
                <td><span><?php if(($vo["kf"]) != "0"): echo ($vo["kf"]); endif; ?></span></td>
                <td><span><?php if(($vo["xsjd"]) != "0"): echo ($vo["xsjd"]); endif; ?></span></td>
                <td><span><?php if(($vo["xxjd"]) != "0"): echo ($vo["xxjd"]); endif; ?></span></td>
				<td><?php echo ($vo["waqianren"]); ?></td>
                <td><?php if(($vo["wqbm"]) != "0"): echo ($vo["wqbm"]); endif; ?></td>
                <td><?php if(($vo["wqry"]) != "0"): echo ($vo["wqry"]); endif; ?></td>
                <td><span><?php echo ($vo["qd"]); ?></span></td>
                <td>
                <span class="setmoney"><?php if(($vo["setmoney"]) != "0"): echo ($vo["setmoney"]); endif; ?></span>              
                </td>
                <td>
                <span class="money"><?php if(($vo["money"]) != "0"): echo ($vo["money"]); endif; ?></span>              
                </td>
                <td><span   <?php if(($vo['ywzt'] == 67) OR ($vo['ywzt'] == 115) OR ($vo['ywzt'] == 151) ): ?>class="cjstate"
								<?php elseif(($vo['ywzt'] == 65) OR ($vo['ywzt'] == 149) OR ($vo['ywzt'] == 64) ): ?> class="lsstate"
								<?php elseif(($vo['ywzt'] == 153) OR ($vo['ywzt'] == 66) ): ?> class="sdstate"
								<?php elseif(($vo['ywzt'] == 63) OR ($vo['ywzt'] == 148)): ?> class="yyjdstate"
								<?php else: ?> class="dqdstate"<?php endif; ?>  ><?php echo ($vo["ywstate"]); ?></span></td>
                <td><span><?php echo ($vo["lb"]); ?></span></td>
				<td><span><a href="javascript:" rel='dropmenu<?php echo ($vo["id"]); ?>'><?php echo (msubstr($vo["bz"],0,3,'utf-8',false)); ?></a></span></td>
				<ul id="dropmenu<?php echo ($vo["id"]); ?>" class="dropMenu">
					<span> <?php echo ($vo["bz"]); ?></span>
				</ul>
                <td><span><a href="javascript:" rel='dropmenu1<?php echo ($vo["id"]); ?>'><?php echo (msubstr($vo["xxbz"],0,3,'utf-8',false)); ?></a></span></td>
                <ul id="dropmenu1<?php echo ($vo["id"]); ?>" class="dropMenu">
                    <span> <?php echo ($vo["xxbz"]); ?></span>
                </ul>
				<td><span><?php echo ($vo["gkbq"]); ?></span></td>
				<td><span><?php if($vo['akjj'] == 1): ?>已发
								<?php elseif($vo['akjj'] == 2 ): ?> 未发
								<?php else: endif; ?></span></td>
				<td><span><?php if($vo['cjjj'] == 1): ?>已发
								<?php elseif($vo['cjjj'] == 2 ): ?> 未发
								<?php else: endif; ?></span></td>
                <td><span><?php echo (time_format($vo["cztime"])); ?></span></td>
                <td>
                    <a class="gengxin" title="查看" href="<?php echo U('cat?id='.$vo['id']);?>"><img src="/Public/Admin/images/view.png" alt="查看"></a>
                    <a  title="更新 " class="gengxin"  href="<?php echo U('edit',array('id'=>$vo['id'],'p'=>$_GET['p']));?>"><img src="/Public/Admin/images/update.png" alt="更新"></a>
                    <a class="confirm ajax-get" title="删除" href="<?php echo U('del',array('id'=>$vo['id'],'p'=>$_GET['p']));?>"><img src="/Public/Admin/images/delete.png" alt="删除"></a>
                    <a title="分配"  class="fenpei"  href="<?php echo U('fp',array('id'=>$vo['id']));?>"><img src="/Public/Admin/images/group_go.png" alt="分配"></a>
                    <a class="confirm ajax-get" title="未到店" href="<?php echo U('wdd?id='.$vo['id']);?>"><img src="/Public/Admin/images/come.png" alt="未到店"></a>
                    <a class="cj ajax-get" href="javascript:void(0);" title="成交"  ><img src="/Public/Admin/images/done.png" alt="成交"></a>
					<a  id='yongjin' href="javascript:yongjin(<?php echo ($vo["id"]); ?>);" title="修改佣金"  ><img src="/Public/Admin/images/update.png" alt="修改佣金"></a>
                </td>
            </tr><?php endforeach; endif; else: echo "" ;endif; ?>
            <?php else: ?>
            <td colspan="24" class="text-center"> aOh! 暂时还没有内容! </td><?php endif; ?>
        </tbody>
        </table>
    </form>
	</div>
    <div class="page">
        <?php echo ($_page); ?>
    </div>
<div id="bg"></div>
<div class="box" style="display:none">
    <h2>成交<a href="#" class="close">关闭</a></h2>
	<div class="fakeloader"></div>
    <div class="list">
	
        <ul><form action="" id="commentForm" method="post"  class="form-horizontal" >
			<input class="showbtn" type="hidden" name="id" value=""/>
			<div class="form-item">
				<label class="item-label">订单状态：<span class="check-tips"></span></label>
				<div class="controls">
					<select name="ywstate" >
						<?php if(is_array($state)): $i = 0; $__LIST__ = array_slice($state,5,7,true);if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option value="<?php echo ((isset($vo["uid"]) && ($vo["uid"] !== ""))?($vo["uid"]):null); ?>" <?php if(($vo["uid"]) == $data["ywstate"]): ?>selected<?php endif; ?>><?php echo ((isset($vo["name"]) && ($vo["name"] !== ""))?($vo["name"]):null); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
					</select>
				</div>
			</div>
			<div class="form-item">
				<label class="item-label">成交金额：<span class="check-tips"></span></label>
				<div class="controls">
					<input type="text" name="money" value="">
				</div>
			</div>
			<div class="form-item">
			<label class="item-label">支付款项：<span class="check-tips"></span></label>
				<div class="controls">
							
					<select name="zfkx">
							<option value="">无</option>
						<?php if(is_array($zfkx)): $i = 0; $__LIST__ = $zfkx;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option value="<?php echo ((isset($vo["uid"]) && ($vo["uid"] !== ""))?($vo["uid"]):null); ?>" <?php if(($vo["uid"]) == $data["zfkx"]): ?>selected<?php endif; ?>><?php echo ((isset($vo["name"]) && ($vo["name"] !== ""))?($vo["name"]):null); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
					</select>
				</div>
			</div>
            <div class="form-item">
			<label class="item-label">支付方式：<span class="check-tips"></span></label>
				<div class="controls">
							
					<select name="zffs">
							<option value="">无</option>
						<?php if(is_array($zffs)): $i = 0; $__LIST__ = $zffs;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option value="<?php echo ((isset($vo["uid"]) && ($vo["uid"] !== ""))?($vo["uid"]):null); ?>" <?php if(($vo["uid"]) == $data["zffs"]): ?>selected<?php endif; ?>><?php echo ((isset($vo["name"]) && ($vo["name"] !== ""))?($vo["name"]):null); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
					</select>
				</div>
			</div>
			<div class="form-item">
				<label class="item-label">排档时间<span class="check-tips">（如拍档时间只有1天，只填写开始时间，若果多天需要填写结束时间）</span></label>
				<div class="controls">
					 <input type="text" placeholder="请输入拍档开始时间" class="text laydate-icon" onclick="laydate({istime: true, format: 'YYYY-MM-DD'})" name="pdtimes" > - 
					 <input type="text" placeholder="请输入拍档结束时间" class="text  laydate-icon" onclick="laydate({istime: true, format: 'YYYY-MM-DD'})" name="pdtimee" >
				</div>
			</div>
			<div style="margin-top:10px;">
				<button class="btn tijiao" id="submit" type="submit">确 定</button>
			</div>
			</form>
        </ul>
    </div>
	<div id="AjaxLoading" class="showbox">
		<div class="loadingWord"><img src="/Public/Admin/images/waiting.gif">数据提交中，请稍候...</div>
	</div>
</div>


        </div>
        <div class="cont-ft">
            <div class="copyright">
               <!--  <div class="fl" >感谢使用<a href="http://www.gv-photo.com" target="_blank">OneThink</a>管理平台</div>
                <div class="fr">V<?php echo (ONETHINK_VERSION); ?></div> -->
            </div>
        </div>
    </div>
    <!-- /内容区 -->
    <script type="text/javascript">
    (function(){
        var ThinkPHP = window.Think = {
            "ROOT"   : "", //当前网站地址
            "APP"    : "/index.php?s=", //当前项目地址
            "PUBLIC" : "/Public", //项目公共目录地址
            "DEEP"   : "<?php echo C('URL_PATHINFO_DEPR');?>", //PATHINFO分割符
            "MODEL"  : ["<?php echo C('URL_MODEL');?>", "<?php echo C('URL_CASE_INSENSITIVE');?>", "<?php echo C('URL_HTML_SUFFIX');?>"],
            "VAR"    : ["<?php echo C('VAR_MODULE');?>", "<?php echo C('VAR_CONTROLLER');?>", "<?php echo C('VAR_ACTION');?>"]
        }
    })();
    </script>
    <script type="text/javascript" src="/Public/static/think.js"></script>
    <script type="text/javascript" src="/Public/Admin/js/common.js"></script>
    <script type="text/javascript">
        +function(){
            var $window = $(window), $subnav = $("#subnav"), url;
            $window.resize(function(){
                $("#main").css("min-height", $window.height() - 130);
            }).resize();

            /* 左边菜单高亮 */
            url = window.location.pathname + window.location.search;
            url = url.replace(/(\/(p)\/\d+)|(&p=\d+)|(\/(id)\/\d+)|(&id=\d+)|(\/(group)\/\d+)|(&group=\d+)/, "");
            $subnav.find("a[href='" + url + "']").parent().addClass("current");

            /* 左边菜单显示收起 */
            $("#subnav").on("click", "h3", function(){
                var $this = $(this);
                $this.find(".icon").toggleClass("icon-fold");
                $this.next().slideToggle("fast").siblings(".side-sub-menu:visible").
                      prev("h3").find("i").addClass("icon-fold").end().end().hide();
            });

            $("#subnav h3 a").click(function(e){e.stopPropagation()});

            /* 头部管理员菜单 */
            $(".user-bar").mouseenter(function(){
                var userMenu = $(this).children(".user-menu ");
                userMenu.removeClass("hidden");
                clearTimeout(userMenu.data("timeout"));
            }).mouseleave(function(){
                var userMenu = $(this).children(".user-menu");
                userMenu.data("timeout") && clearTimeout(userMenu.data("timeout"));
                userMenu.data("timeout", setTimeout(function(){userMenu.addClass("hidden")}, 100));
            });

	        /* 表单获取焦点变色 */
	        $("form").on("focus", "input", function(){
		        $(this).addClass('focus');
	        }).on("blur","input",function(){
				        $(this).removeClass('focus');
			        });
		    $("form").on("focus", "textarea", function(){
			    $(this).closest('label').addClass('focus');
		    }).on("blur","textarea",function(){
			    $(this).closest('label').removeClass('focus');
		    });

            // 导航栏超出窗口高度后的模拟滚动条
            var sHeight = $(".sidebar").height();
            var subHeight  = $(".subnav").height();
            var diff = subHeight - sHeight; //250
            var sub = $(".subnav");
            if(diff > 0){
                $(window).mousewheel(function(event, delta){
                    if(delta>0){
                        if(parseInt(sub.css('marginTop'))>-10){
                            sub.css('marginTop','0px');
                        }else{
                            sub.css('marginTop','+='+10);
                        }
                    }else{
                        if(parseInt(sub.css('marginTop'))<'-'+(diff-10)){
                            sub.css('marginTop','-'+(diff-10));
                        }else{
                            sub.css('marginTop','-='+10);
                        }
                    }
                });
            }
        }();
    </script>
    
    <script src="/Public/static/thinkbox/jquery.thinkbox.js"></script>
	<script src="/Public/static/thinkbox/laydate.js"></script>
	<script src="/Public/static/thinkbox/fakeLoader.min.js"></script>
	<script src="/Public/static/layer/layer.js"></script>
	<script type='text/javascript' src='/Public/static/thinkbox/dropdown.js'></script>
	<script type="text/javascript">cssdropdown.startchrome("navMenu")</script> 
	<script type="text/javascript">
	
	
	//iframe层-禁滚动条
	function yongjin(id){
		layer.open({
		  type: 2,
		  title: '佣金修改',
		  area: ['600px', '500px'],
		  skin: 'layui-layer-rim', //加上边框
		  content: ['/index.php?s=/Ywxt/yongjin/id/'+id, 'no']
		});
	}
     var wqbm       = $('#wqbm');
     var wqry       = $('#wqry');
	 wqbm.change(function(){
                if($(this).val() == ''){
                    wqry.empty();
                    $("<option value=''>"+'请选择挖潜人员'+"</optinon>").appendTo(wqry);
                }else{
                    wqry.empty();
                    $("<option value=''>"+'请选择挖潜人员'+"</optinon>").appendTo(wqry);
                    $.post("<?php echo U('waqian/waqianrenyuan');?>", { id:$(this).val()},function(data){
                        $.each(eval(data),function(i,n){
                            $("<option value='"+n.id+"'>"+n.title+"</optinon>").appendTo(wqry);
                        });
                    });
                }
            });
    //成交功能		
       $(".tijiao").click(function(){
	    //alert('ssss');	
            $.ajax({
                type: "POST",
                url: "<?php echo U('cj');?>",
                data: $("form").serialize(),
                beforeSend:function(){
                $(".overlay").css({'display':'block','opacity':'0.8'});
                $(".showbox").stop(true).animate({'margin-top':'300px','opacity':'1'},200);//loanding 打开显示
                    
                },
                success: function(msg){
                $(".showbox").stop(true).animate({'margin-top':'250px','opacity':'0'},400);
                $(".overlay").css({'display':'none','opacity':'0'});//loanding 停止显示    
                $('.alert-content').html(msg.info);
                    $('#top-alert').addClass('alert-success').show();
                    setTimeout(function(){
                       location.href=msg.url;
                    },2000); //延迟演示
                },
            });
			return false;	
        });
		$(".tijiao").ajaxStart(function(){
				$(".fakeloader").fakeLoader({
					bgColor:"#9b59b6",
					spinner:"spinner7"
				});
		});
	
    //点击显示成交按钮
    $(".cj").click(function(){ 
        var username = "<?php echo ($quanxian); ?>"; 
        if(username == 4){
            $('#top-alert').show();
            $('.alert-content').html('您没有权限！');
            setTimeout(function(){$('#top-alert').hide();},2000);
        }else{
        //$(this).parent().parent('tr').find('span').siblings().show();
        var money = $(this).parent().parent('tr').find('.money_id').html();
		$(".showbtn").val(money);
		//弹出层
			//$(".showbtn").click(function () {
		

				$("#bg").css({
					display: "block", height: $(document).height()
				});
				var $box = $('.box');
				$box.css({
					//设置弹出层距离左边的位置
					left: ($("body").width() - $box.width()) / 2 + 100 + "px",
					//设置弹出层距离上面的位置
					top: ($(window).height() - $box.height()) / 2 + $(window).scrollTop() + "px",
					display: "block"
				});
			//});
			//点击关闭按钮的时候，遮罩层关闭
			$(".close").click(function () {
				$("#bg,.box").css("display", "none");
			});
        }
        return false;
    });
    //点击显示分配按钮，ajax.get方法判断是否用户有权
    $(".fenpei").click(function(){
         var fenpeiurl = $(this).attr("href"); //获取当前标签中的URL
         $.get(fenpeiurl,function(data){
                    //alert("info: " + data.info + "\nStatus: " + data.status);
                    if(data.status == 0){ //判断是否有权限，0表示假
                       $('#top-alert').show();
                       $('.alert-content').html(data.info);
                       setTimeout(function(){$('#top-alert').hide();},2000); 
                    }else{
                        location.href = fenpeiurl; //跳转
                    }
                 });
            
         return false; 
    });
   //点击显示编辑按钮
   $(".gengxin").click(function(){
         var gengxinurl = $(this).attr("href"); //获取当前标签中的URL
         $.get(gengxinurl,function(data){
                    //alert("info: " + data.info + "\nStatus: " + data.status);
                    if(data.status == 0){ //判断是否有权限，0表示假
                       $('#top-alert').show();
                       $('.alert-content').html(data.info);
                       setTimeout(function(){$('#top-alert').hide();},2000); 
                    }else{
                        location.href = gengxinurl; //跳转
                    }
                 });
            
         return false; 
    });
	//搜索功能
	$("#search").trigger(function(){
		var url = $(this).attr('url');
        var query  = $('.search-form').find('input').serialize();
        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
        query = query.replace(/^&/g,'');
        if( url.indexOf('?')>0 ){
            url += '&' + query;
        }else{
            url += '?' + query;
        }
		window.location.href = url;
	});
	//回车搜索
	$(".search-input").keyup(function(e){
		if(e.keyCode === 13){
			$("#search").click(function(){
                 $(this).parent().parent('tr').find('td.money'); 
            });
			
		}
	});
     //导航高亮
            highlight_subnav('<?php echo U('index');?>');
	</script>

</body>
</html>